Perspective distortion is common in pictures when a camera is not parallel to surfaces or edges that are being photographed. For example, a tall building photographed from the ground at a distance may appear slanted in the image, or the edges of the building may appear non-vertical (or convergent) even though the building is in reality vertical. As another example of perspective distortion, text or words on a photographed surface (e.g., a document, whiteboard/blackboard, or product) can appear distorted and difficult to read when the camera is not parallel to the photographed surface. Such distortion can sometimes be corrected using various perspective correction techniques.
Perspective correction for a picture is commonly performed by detecting the border or an edge of a surface in the picture. The position and orientation of the edge within the picture may be used to determine the position of the surface in space. Then, a transform can be applied to that surface to adjust the perspective. However, when a picture does not include a border or an edge, it can be difficult or impossible to determine the position of the surface in space and, thus, to correct the perspective distortion. For example, some perspective correction techniques require that one or more edges of a photographed document be included in the photo in order to correct perspective distortion of the text appearing on the document. Such a requirement can be impractical or impossible to realize. For example, a user taking the photograph may not be able to position his or herself such that the surface being photographed, and requiring perspective correction, is entirely within the viewfinder of the camera.